<!doctype html>
<title>Canvas text</title>
<meta charset="UTF-8">

<canvas width="550" height="400" style="border: 1px dashed black"></canvas>

<script>

//The canvas and its drawing surface
var canvas = document.querySelector("canvas");
var drawingSurface = canvas.getContext("2d");

//Canvas text properties
drawingSurface.font = "normal bold 24px Helvetica";
drawingSurface.fillStyle = "#000";
drawingSurface.textBaseline = "top";

//Display the text
drawingSurface.fillText("Any text to display", 100, 180);

</script>